package com.micro.ai.models.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 微调数据集实体类
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@TableName("fine_tuning_datasets")
@Schema(description = "微调数据集信息")
public class FineTuningDataset implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "数据集ID", example = "ds_123456789")
    private String id;

    /**
     * 租户ID
     */
    @Schema(description = "租户ID", example = "tenant_001", required = true)
    private String tenantId;

    /**
     * 数据集名称
     */
    @Schema(description = "数据集名称", example = "中文对话数据集", required = true)
    private String name;

    /**
     * 数据集描述
     */
    @Schema(description = "数据集描述", example = "包含10万条中文对话数据")
    private String description;

    /**
     * 文件存储路径
     */
    @Schema(description = "文件存储路径", example = "/data/datasets/chinese_dialog.jsonl")
    private String filePath;

    /**
     * 文件格式
     */
    @Schema(description = "文件格式", example = "jsonl", allowableValues = {"jsonl", "csv", "txt", "parquet"})
    private String fileFormat;

    /**
     * 文件大小(字节)
     */
    @Schema(description = "文件大小（字节）", example = "10485760")
    private Long fileSize;

    /**
     * 总记录数
     */
    @Schema(description = "总记录数", example = "10000")
    private Integer totalRecords;

    /**
     * 数据结构定义（JSON）
     */
    @Schema(description = "数据结构定义（JSON格式）", example = "{\"fields\":[\"input\",\"output\"]}")
    private String dataStructure;

    /**
     * 数据质量评分
     */
    @Schema(description = "数据质量评分（0-1）", example = "0.95")
    private double qualityScore;

    /**
     * 状态
     */
    @Schema(description = "状态", example = "ready", allowableValues = {"uploading", "processing", "ready", "error"})
    private String status;

    /**
     * 错误信息
     */
    @Schema(description = "错误信息", example = "文件格式不正确")
    private String errorMessage;

    /**
     * 创建人ID
     */
    @Schema(description = "创建人ID", example = "1001", required = true)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间", example = "2025-01-01 00:00:00")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间", example = "2025-01-01 00:00:00")
    private LocalDateTime updatedAt;
}
